package com.gary.springcloud.call.task;

import com.gary.springcloud.call.entity.ExecutorResult;

import java.util.concurrent.Callable;

/**
 * @author peng_rui
 * @date 2023/1/9
 */
public class TestCallable implements Callable<ExecutorResult> {
    private String name;

    public TestCallable(String name) {
        this.name = name;
    }

    @Override
    public ExecutorResult call() throws Exception {
        System.out.println(Thread.currentThread().getName() + ".....this task name : " + this.name);
        ExecutorResult result = new ExecutorResult();
        result.setMsg("call success");
        return result;
    }
}
